﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BMSQ.Admin
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, ImageClickEventArgs e)
        {
            if (txtUsername.Text.Trim() == "")
            {
                lblMsg.Text = "用户名不能为空.";
                return;
            }
            Vincent.Permission.Model.Ex.UserInfo userInfo =  Vincent.Permission.Functions.Account.Login(txtUsername.Text.Trim(), txtPass.Text.Trim());

            if (userInfo == null)
            {
                lblMsg.Text = "用户名或者密码不正确.";
                return;
            }
            else
            {
                Common.UserInfo = userInfo;
                Response.Redirect("/index.aspx");
            }
        }
    }
}